import { Define, EntityObjectFactory } from 'tiny-entity2';
const EntityObjectType = EntityObjectFactory.GetEntityObjectType(process.env.dataBaseType || 'mysql');

@Define.Table({ TableName: "updateurl" })
export class UpdateUrl extends EntityObjectType<UpdateUrl>{
    @Define.PrimaryKey()
    id: string;

    @Define.Column({
        DataType: Define.DataType.BIGINT
    })
    lastSyncTime: number;

    @Define.Column({
        DataType: Define.DataType.VARCHAR
    })
    type: string;

    @Define.Column({
        DataType: Define.DataType.BIGINT
    })
    version: number;

    @Define.Column({
        DataType: Define.DataType.VARCHAR
    })
    url: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR
    })
    objectId: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR
    })
    actionType: string;

    @Define.Column({
        DataType: Define.DataType.INT,
        DefaultValue: 0,
        DataLength: 10
    })
    errorCount: number;
}

export const SyncActionType = {
    Create: 'create',
    Update: 'update',
    Delete: 'delete'
}


